package net.googlecode.morenko.task5.calculators;

import net.googlecode.morenko.task5.workers.Director;
import net.googlecode.morenko.task5.workers.Worker;

/**
 * Class that realize calculating salary for directors.
 */
public class DirectorCalculator implements Calculator {
    private final int TAX = 500;
    private final int HOURS_PER_RATE = 170;

    /**
     * @see Calculator
     * @param person
     * @return calculated salary.
     */
    public int calculateSalary(Worker person) {
        Director director = (Director)person;
        int salary = 0;
        salary = HOURS_PER_RATE * director.getRate() - TAX + director.getBonusAmount();
        return salary;
    }
}
